<?php if (!defined("_ECRIRE_INC_VERSION")) return;

/**
 *  Dymanic Tag wich outputs currency's sign by currency code
 *  Format: #ECATALOGUE_CURRENCY_SIGN{<code>, <sign>}
 *      If you want to output sign_pre, leave <sign> empty
 */

function balise_ECATALOGUE_CURRENCY_SIGN($p) {	
	return calculer_balise_dynamique($p,'ECATALOGUE_CURRENCY_SIGN', array());
}

function balise_ECATALOGUE_CURRENCY_SIGN_stat($args, $filtres) {    
	return $args;
}

function balise_ECATALOGUE_CURRENCY_SIGN_dyn($currency_code = false, $sign = 'sign_pre') {
    require_once(_DIR_PLUGIN_ECATALOGUE.'classes/class.CurrencyModel.php');
    $currency_mdl = new CurrencyModel();    
    
    // If $currency_code isn't defined, current currency sign will be returned
    if (!$currency_code)
        $currency = $currency_mdl->GetCurrentCurrency();
    else     
        $currency = $currency_mdl->SelectByCode($currency_code);
    //$sign = $currency[$sign];
    include_spip('inc/filtres');
    if ($currency)
        $sign = extraire_multi($currency[$sign]);
    else 
        $sign = '';     
        
    return array('balise/ecatalogue_currency_sign', 0, 
		array('sign' => $sign            
    ));
}

?>